/**
 * 功能描述
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/enchashment_main.tpl");
    require("./assets/css/enchashment_main.css");

    //business

    //component
    var enchashmentSubnavComp = require("./component/enchashmentSubnavComp");
    var enchashmentGridComp = require("./component/enchashmentGridComp");
//    var welfareFormComp = require("./component/welfareFormComp");
    //constant

    //handler

    //store

    var welfareconsupon_main = ELView.extend({
        attrs: {
            template: template
        },
        initComponent: function (params, widget) {
        	enchashmentSubnavComp.initComponent(params, widget);
        	enchashmentGridComp.initComponent(params, widget);
        },
        afterInitComponent: function (params, widget) {
        	widget.get("grid").refresh(null,function(data){
       		 var j = 0;
                for(var i in data){
                	 j += parseFloat(data[i].price);
                }
                widget.get("grid").setTitle("取现合计："+j+"元 ");
       	});
        }
    });

    module.exports = welfareconsupon_main;
});
